package com.mt.mall.entity.merchant;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import com.mt.common.system.entity.Attachment;
import com.mt.common.system.entity.User;
import com.mt.mall.entity.merchant.Shop;

@DEntity(label="关注店铺",comment="",moduleLabel="关注店铺")
@Entity(name="mall_follow_store")
@Table(name = "mall_follow_store" , indexes = { @Index(name = "index_shop_id", columnList = "shop_id"),@Index(name = "index_attachments_id", columnList = "attachments_id"),@Index(name = "index_user_id", columnList = "user_id")  })
@ApiModel(description = "关注店铺:")
public class FollowStore extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="店铺",foreignEntity="Shop",comment="",component="对象选择",where=true)
	@ApiModelProperty(value = "店铺:")
	@Column(name="shop_id",length=255,nullable=false,unique=false)
	private Long shopId;

	@Transient
	private Shop shop;

	@Transient
	@ApiModelProperty(value = "店铺名称:")
	@DColumn(index=3,label="店铺",foreignEntity="Shop",comment="")
	private String shopName;

	@DColumn(index=4,label="附件",foreignEntity="Attachment",comment="附件",component="对象选择",where=false)
	@ApiModelProperty(value = "附件:附件")
	@Column(name="attachments_id",length=255,nullable=true,unique=false)
	private Long attachmentsId;

	@Transient
	private Attachment attachments;

	@Transient
	@ApiModelProperty(value = "附件名称:附件")
	@DColumn(index=4,label="附件",foreignEntity="Attachment",comment="附件")
	private String attachmentsName;

	@DColumn(index=5,label="购买用户",foreignEntity="User",comment="购买用户",component="对象选择",where=true)
	@ApiModelProperty(value = "购买用户:购买用户")
	@Column(name="user_id",length=255,nullable=false,unique=false)
	private Long userId;

	@Transient
	private User user;

	@Transient
	@ApiModelProperty(value = "购买用户名称:购买用户")
	@DColumn(index=5,label="购买用户",foreignEntity="User",comment="购买用户")
	private String userName;


	public Long getShopId() {
		return this.shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}

	public Long getAttachmentsId() {
		return this.attachmentsId;
	}

	public void setAttachmentsId(Long attachmentsId) {
		this.attachmentsId = attachmentsId;
	}

	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		if(shop == null){
		}
		else
		{
		this.shopId = shop.getEid();
		this.shop = shop;		
		}
}

	public String getShopName() {
		return this.shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public Attachment getAttachments() {
		return this.attachments;
	}

	public void setAttachments(Attachment attachments) {
		if(attachments == null){
		}
		else
		{
		this.attachmentsId = attachments.getEid();
		this.attachments = attachments;		
		}
}

	public String getAttachmentsName() {
		return this.attachmentsName;
	}

	public void setAttachmentsName(String attachmentsName) {
		this.attachmentsName = attachmentsName;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		if(user == null){
		}
		else
		{
		this.userId = user.getEid();
		this.user = user;		
		}
}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}



}
